% Intrinsic and Extrinsic Camera Parameters
%
% This script file can be directly executed under Matlab to recover the camera intrinsic and extrinsic parameters.
% IMPORTANT: This file contains neither the structure of the calibration objects nor the image coordinates of the calibration points.
%            All those complementary variables are saved in the complete matlab data file Calib_Results.mat.
% For more information regarding the calibration model visit http://www.vision.caltech.edu/bouguetj/calib_doc/


%-- Focal length:
fc = [ 689.544210588855321 ; 690.043823297868244 ];

%-- Principal point:
cc = [ 337.870633860870896 ; 274.603725467620791 ];

%-- Skew coefficient:
alpha_c = 0.000000000000000;

%-- Distortion coefficients:
kc = [ 0.328353407553401 ; -0.848808799225900 ; 0.000827893734987 ; 0.001539479784809 ; 0.000000000000000 ];

%-- Focal length uncertainty:
fc_error = [ 3.624287847867248 ; 3.527703430373342 ];

%-- Principal point uncertainty:
cc_error = [ 2.283696573901512 ; 2.773283253448565 ];

%-- Skew coefficient uncertainty:
alpha_c_error = 0.000000000000000;

%-- Distortion coefficients uncertainty:
kc_error = [ 0.014899160612867 ; 0.058363156533302 ; 0.002062892443963 ; 0.001649080396631 ; 0.000000000000000 ];

%-- Image size:
nx = 640;
ny = 480;


%-- Various other variables (may be ignored if you do not use the Matlab Calibration Toolbox):
%-- Those variables are used to control which intrinsic parameters should be optimized

n_ima = 27;						% Number of calibration images
est_fc = [ 1 ; 1 ];					% Estimation indicator of the two focal variables
est_aspect_ratio = 1;				% Estimation indicator of the aspect ratio fc(2)/fc(1)
center_optim = 1;					% Estimation indicator of the principal point
est_alpha = 0;						% Estimation indicator of the skew coefficient
est_dist = [ 1 ; 1 ; 1 ; 1 ; 0 ];	% Estimation indicator of the distortion coefficients


%-- Extrinsic parameters:
%-- The rotation (omc_kk) and the translation (Tc_kk) vectors for every calibration image and their uncertainties

%-- Image #1:
omc_1 = [ 1.938277e+00 ; 2.021997e+00 ; 4.934516e-02 ];
Tc_1  = [ -2.823067e+01 ; -6.581156e+01 ; 4.668178e+02 ];
omc_error_1 = [ 3.794729e-03 ; 3.268303e-03 ; 6.999542e-03 ];
Tc_error_1  = [ 1.541864e+00 ; 1.859272e+00 ; 2.517492e+00 ];

%-- Image #2:
omc_2 = [ 2.179505e+00 ; 1.492257e+00 ; 1.441844e-01 ];
Tc_2  = [ -9.756549e+01 ; -4.643827e+01 ; 4.383723e+02 ];
omc_error_2 = [ 3.794680e-03 ; 2.578787e-03 ; 5.746074e-03 ];
Tc_error_2  = [ 1.462369e+00 ; 1.756610e+00 ; 2.473612e+00 ];

%-- Image #3:
omc_3 = [ 2.630771e+00 ; 1.249694e+00 ; -1.444913e-01 ];
Tc_3  = [ -9.495017e+01 ; -5.981219e+01 ; 5.543764e+02 ];
omc_error_3 = [ 5.705080e-03 ; 2.713510e-03 ; 8.043243e-03 ];
Tc_error_3  = [ 1.836724e+00 ; 2.211954e+00 ; 3.004623e+00 ];

%-- Image #4:
omc_4 = [ -2.018262e+00 ; -1.990071e+00 ; -5.171534e-01 ];
Tc_4  = [ 1.517434e+01 ; -7.311940e+01 ; 4.713751e+02 ];
omc_error_4 = [ 3.031486e-03 ; 4.357804e-03 ; 6.990855e-03 ];
Tc_error_4  = [ 1.574075e+00 ; 1.886231e+00 ; 2.751289e+00 ];

%-- Image #5:
omc_5 = [ -1.925864e+00 ; -1.945972e+00 ; 8.328274e-01 ];
Tc_5  = [ 5.000746e+01 ; -9.381601e+01 ; 6.095356e+02 ];
omc_error_5 = [ 3.993311e-03 ; 3.558911e-03 ; 7.122675e-03 ];
Tc_error_5  = [ 2.030509e+00 ; 2.430741e+00 ; 2.911099e+00 ];

%-- Image #6:
omc_6 = [ 2.053453e+00 ; 1.815125e+00 ; 9.022182e-02 ];
Tc_6  = [ -1.582286e+02 ; -1.018246e+02 ; 5.137782e+02 ];
omc_error_6 = [ 4.174884e-03 ; 3.794957e-03 ; 7.852642e-03 ];
Tc_error_6  = [ 1.721633e+00 ; 2.088821e+00 ; 2.975107e+00 ];

%-- Image #7:
omc_7 = [ -2.081768e+00 ; -2.145424e+00 ; 6.517675e-02 ];
Tc_7  = [ -2.318715e+01 ; -1.784083e+02 ; 5.691716e+02 ];
omc_error_7 = [ 7.701962e-03 ; 7.782952e-03 ; 1.333998e-02 ];
Tc_error_7  = [ 1.921617e+00 ; 2.286617e+00 ; 3.311519e+00 ];

%-- Image #8:
omc_8 = [ 2.189395e+00 ; 2.015585e+00 ; -4.876569e-01 ];
Tc_8  = [ -5.905820e+01 ; -3.723945e+01 ; 5.403721e+02 ];
omc_error_8 = [ 4.443729e-03 ; 4.013586e-03 ; 8.567103e-03 ];
Tc_error_8  = [ 1.773880e+00 ; 2.152345e+00 ; 2.743333e+00 ];

%-- Image #9:
omc_9 = [ 2.081177e+00 ; 2.002217e+00 ; -4.727747e-02 ];
Tc_9  = [ 5.269287e+01 ; -6.561514e+01 ; 8.352440e+02 ];
omc_error_9 = [ 5.776761e-03 ; 5.034984e-03 ; 1.096453e-02 ];
Tc_error_9  = [ 2.791261e+00 ; 3.343541e+00 ; 4.790013e+00 ];

%-- Image #10:
omc_10 = [ 1.766874e+00 ; 1.992949e+00 ; 2.362758e-01 ];
Tc_10  = [ -7.686234e+00 ; -8.896461e+01 ; 7.859075e+02 ];
omc_error_10 = [ 4.752033e-03 ; 3.952321e-03 ; 7.802878e-03 ];
Tc_error_10  = [ 2.614121e+00 ; 3.149488e+00 ; 4.332020e+00 ];

%-- Image #11:
omc_11 = [ 1.663177e+00 ; 1.850545e+00 ; 5.122983e-01 ];
Tc_11  = [ -1.027539e+01 ; -1.033165e+02 ; 7.687044e+02 ];
omc_error_11 = [ 4.353160e-03 ; 3.434548e-03 ; 6.346387e-03 ];
Tc_error_11  = [ 2.560542e+00 ; 3.082059e+00 ; 4.328274e+00 ];

%-- Image #12:
omc_12 = [ -1.953104e+00 ; -2.173886e+00 ; -8.440831e-01 ];
Tc_12  = [ 3.083613e+01 ; -4.100750e+01 ; 5.746907e+02 ];
omc_error_12 = [ 2.627528e-03 ; 4.834606e-03 ; 6.848631e-03 ];
Tc_error_12  = [ 1.918752e+00 ; 2.317851e+00 ; 3.491124e+00 ];

%-- Image #13:
omc_13 = [ -1.816314e+00 ; -1.961348e+00 ; 3.277883e-01 ];
Tc_13  = [ 6.695303e+01 ; -1.023106e+02 ; 7.007270e+02 ];
omc_error_13 = [ 4.898852e-03 ; 5.242694e-03 ; 9.960644e-03 ];
Tc_error_13  = [ 2.350791e+00 ; 2.804524e+00 ; 3.795311e+00 ];

%-- Image #14:
omc_14 = [ 1.936887e+00 ; 2.216316e+00 ; 1.725744e-02 ];
Tc_14  = [ 1.681543e+02 ; -8.895296e+01 ; 8.059564e+02 ];
omc_error_14 = [ 6.108214e-03 ; 4.654149e-03 ; 1.124784e-02 ];
Tc_error_14  = [ 2.709987e+00 ; 3.261035e+00 ; 4.509321e+00 ];

%-- Image #15:
omc_15 = [ -2.316330e+00 ; -2.119849e+00 ; 2.498206e-01 ];
Tc_15  = [ -3.093083e+02 ; -9.214509e+01 ; 7.686264e+02 ];
omc_error_15 = [ 6.756304e-03 ; 4.590428e-03 ; 1.198524e-02 ];
Tc_error_15  = [ 2.631434e+00 ; 3.239410e+00 ; 4.585740e+00 ];

%-- Image #16:
omc_16 = [ 2.088713e+00 ; 1.981505e+00 ; 5.710636e-01 ];
Tc_16  = [ -2.900978e+02 ; -2.559593e+02 ; 7.609931e+02 ];
omc_error_16 = [ 7.125711e-03 ; 1.110336e-02 ; 1.659698e-02 ];
Tc_error_16  = [ 2.674492e+00 ; 3.067438e+00 ; 5.742623e+00 ];

%-- Image #17:
omc_17 = [ 1.958420e+00 ; 2.008359e+00 ; 2.011088e-01 ];
Tc_17  = [ -3.156655e+02 ; 3.795970e+01 ; 7.946926e+02 ];
omc_error_17 = [ 1.192451e-02 ; 1.403365e-02 ; 2.466353e-02 ];
Tc_error_17  = [ 2.762613e+00 ; 3.271075e+00 ; 5.638026e+00 ];

%-- Image #18:
omc_18 = [ 2.231943e+00 ; 2.119292e+00 ; 1.843590e-01 ];
Tc_18  = [ 8.014743e+01 ; 4.648313e+01 ; 7.784851e+02 ];
omc_error_18 = [ 6.569216e-03 ; 4.078020e-03 ; 1.320867e-02 ];
Tc_error_18  = [ 2.597802e+00 ; 3.145201e+00 ; 4.608495e+00 ];

%-- Image #19:
omc_19 = [ 2.241187e+00 ; 2.143656e+00 ; 1.080210e-01 ];
Tc_19  = [ 9.465700e+01 ; -2.622788e+02 ; 8.151533e+02 ];
omc_error_19 = [ 8.311282e-03 ; 8.049769e-03 ; 1.305863e-02 ];
Tc_error_19  = [ 2.829767e+00 ; 3.294988e+00 ; 5.087563e+00 ];

%-- Image #20:
omc_20 = [ -1.797564e+00 ; -1.663673e+00 ; 8.626238e-01 ];
Tc_20  = [ -1.865827e+01 ; -9.662938e+00 ; 7.592321e+02 ];
omc_error_20 = [ 3.858560e-03 ; 3.308293e-03 ; 6.229633e-03 ];
Tc_error_20  = [ 2.525556e+00 ; 3.047058e+00 ; 3.541065e+00 ];

%-- Image #21:
omc_21 = [ 2.061952e+00 ; 1.909797e+00 ; 8.895557e-01 ];
Tc_21  = [ 2.876256e+01 ; -1.904007e+01 ; 6.569469e+02 ];
omc_error_21 = [ 4.594672e-03 ; 2.807483e-03 ; 6.706456e-03 ];
Tc_error_21  = [ 2.192777e+00 ; 2.644525e+00 ; 3.987341e+00 ];

%-- Image #22:
omc_22 = [ -2.121824e+00 ; -2.229390e+00 ; 3.387567e-01 ];
Tc_22  = [ -5.455682e+01 ; -8.533141e+01 ; 5.062858e+02 ];
omc_error_22 = [ 4.269458e-03 ; 4.526735e-03 ; 9.619133e-03 ];
Tc_error_22  = [ 1.666345e+00 ; 2.010408e+00 ; 2.670427e+00 ];

%-- Image #23:
omc_23 = [ 2.053887e+00 ; 2.098494e+00 ; -1.507344e-01 ];
Tc_23  = [ -7.320379e+01 ; -7.782666e+01 ; 6.611434e+02 ];
omc_error_23 = [ 6.420609e-03 ; 5.927006e-03 ; 1.295394e-02 ];
Tc_error_23  = [ 2.184708e+00 ; 2.641650e+00 ; 3.568063e+00 ];

%-- Image #24:
omc_24 = [ -2.443662e+00 ; -1.678289e+00 ; -7.650272e-01 ];
Tc_24  = [ -9.182926e+01 ; -9.103517e+01 ; 4.520058e+02 ];
omc_error_24 = [ 3.968604e-03 ; 3.868479e-03 ; 7.040616e-03 ];
Tc_error_24  = [ 1.521307e+00 ; 1.837875e+00 ; 2.752799e+00 ];

%-- Image #25:
omc_25 = [ 1.575706e+00 ; 1.962979e+00 ; 2.373666e-01 ];
Tc_25  = [ -1.118440e+02 ; -6.750953e+01 ; 5.203278e+02 ];
omc_error_25 = [ 3.405005e-03 ; 3.698978e-03 ; 6.015675e-03 ];
Tc_error_25  = [ 1.734047e+00 ; 2.106022e+00 ; 2.974941e+00 ];

%-- Image #26:
omc_26 = [ -2.581523e+00 ; -1.377487e+00 ; 6.565921e-01 ];
Tc_26  = [ -8.897195e+01 ; -1.299334e+01 ; 5.464114e+02 ];
omc_error_26 = [ 4.545541e-03 ; 2.123822e-03 ; 7.567828e-03 ];
Tc_error_26  = [ 1.801094e+00 ; 2.174701e+00 ; 2.574102e+00 ];

%-- Image #27:
omc_27 = [ 2.068595e+00 ; 2.158207e+00 ; -2.248104e-01 ];
Tc_27  = [ 1.227490e+01 ; -8.013968e+01 ; 6.865417e+02 ];
omc_error_27 = [ 5.726185e-03 ; 5.441950e-03 ; 1.174996e-02 ];
Tc_error_27  = [ 2.286631e+00 ; 2.736868e+00 ; 3.728523e+00 ];

